local key = KEYS[1]
local curentLimit = tonumber(redis.call('get', key) or "0")
redis.call("INCRBY", key, 1)
if curentLimit == 0 then
    redis.call("EXPIRE", key, ARGV[1])
end
return curentLimit + 1